projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f388564
)
cmd: sata: add null pointer check for dev
author
Marcel Ziswiler
<
[email protected]
>
Fri, 1 Feb 2019 15:01:08 +0000
(16:01 +0100)
committer
Tom Rini
<
[email protected]
>
Sat, 9 Feb 2019 12:51:00 +0000
(07:51 -0500)
Calling sata_scan() with a null pointer probably won't make much sense.
Signed-off-by: Marcel Ziswiler <
[email protected]
>
Reviewed-by: Simon Glass <
[email protected]
>
cmd/sata.c
patch
|
blob
|
history
diff --git
a/cmd/sata.c
b/cmd/sata.c
index 6d62ba8f74aaceb9702d9db361e68966b89b304a..a73cc54bd3e97b7ad535a52fc153697e74e37e69 100644
(file)
--- a/
cmd/sata.c
+++ b/
cmd/sata.c
@@
-60,6
+60,10
@@
int sata_probe(int devnum)
printf("Cannot probe SATA device %d (err=%d)\n", devnum, rc);
return CMD_RET_FAILURE;
}
+ if (!dev) {
+ printf("No SATA device found!\n");
+ return CMD_RET_FAILURE;
+ }
rc = sata_scan(dev);
if (rc) {
printf("Cannot scan SATA device %d (err=%d)\n", devnum, rc);